package com.github.zdongcoding.recyclerviewlib.viewholder;

import android.support.annotation.NonNull;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.github.zdg.recyclerview.ItemViewHolder;
import com.github.zdongcoding.recyclerviewlib.R;
import com.github.zdongcoding.recyclerviewlib.model.Item;

public class AnimalViewHolder extends ItemViewHolder<Item> {
    private ImageView mIvAnimalImage;
    private TextView mTvAnimalName;

    public AnimalViewHolder(@NonNull ViewGroup parent) {
        super(parent,R.layout.item_simple_image_layout);
        mTvAnimalName = (TextView) itemView.findViewById(R.id.item_name);
        mIvAnimalImage = (ImageView) itemView.findViewById(R.id.item_image);
    }


    @Override
    public void onBindData(Item item, int position) {
        mTvAnimalName.setText(item.getTitle());
        mIvAnimalImage.setImageResource(item.getDrawableRes());
    }
}
